<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		
		
		<div id="app">
				
				v-model双向绑定
				input输入框的内容会写入到data中!
				直接修改data也会影响输入框的显示[value]!
				<hr>
		
				账号: <input type="text" v-model="user.account" name="account"> <br>
				密码: <input type="password" v-model="user.password" name="pwd"> <br>
				<button type="button" @click="login()">登录</button>
				<button type="button" @click="reset()">重置</button>
	
		</div>
		
		
		<script>
			
			var vue = new Vue({
				el:"#app",
				data:{
					user:{}
				},
				methods:{
					login:function(){
						alert(JSON.stringify(this.user));
					},
					reset:function(){
						this.user = {};
					}
				}
			});
			
			
		</script>
		
		
	</body>
</html>
